# frozen_string_literal: true

class AddColumnsToDecisionTableCells < ActiveRecord::Migration[6.0]
  def change
    add_column :decision_table_cells,
               :int_value,
               :integer,
               null: false, limit: 8, default: 0

    add_column :decision_table_cells,
               :date_value,
               :datetime,
               null: false, default: '2000-01-01'

    add_column :decision_table_cells,
               :bool_value,
               :boolean,
               null: false, default: true

    add_column :decision_table_cells,
               :decimal_value,
               :decimal,
               null: false, default: 0.0, precision: 19, scale: 6

    rename_column :decision_table_cells,
                  :value,
                  :str_value
  end
end
